<?php

declare(strict_types=1);
/**
 * 用户相关控制器
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
namespace App\Controller;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\RequestMapping;

/**
 * @Controller()
 */
class UserController extends AbstractController
{
    /**
     * @RequestMapping(path="index", methods="get")
     */
    public function index()
    {
        $user = $this->request->input('user', 'Hyperf');
        $method = $this->request->getMethod();

        $snowflake = new \Godruoyi\Snowflake\Snowflake;

        echo $snowflake->id();

        return [
            'method' => $method,
            'message' => "Hello {$user}.",
        ];
    }
}
